Guild icon
PLU CSCI 390 Group
Text Channels / api-shiz
Avatar
A free test data generator and API mocking tool - Mockaroo lets you create custom CSV, JSON, SQL, and Excel datasets to test and demo your software.
A free test data generator and API mocking tool - Mockaroo lets you create custom CSV, JSON, SQL, and Excel datasets to test and demo your software.
A free test data generator and API mocking tool - Mockaroo lets you create custom CSV, JSON, SQL, and Excel datasets to test and demo your software.
A free test data generator and API mocking tool - Mockaroo lets you create custom CSV, JSON, SQL, and Excel datasets to test and demo your software.
Avatar
@Eric Golde, where were you deciding those pojos going?
13:02
because I'm about to generate the stubs for the endpoints on the server end
Avatar
Avatar
Chris
@Eric Golde, where were you deciding those pojos going?
webb.shared?
13:04
or webb.shared.pojos
13:04
something that makes it ovious they are shared between client and server
Avatar
Gotcha, that'll be helpful
Avatar
Also, for the leaderboard. Right now its username, time, score. Do you want me to change it to just be usernamd and completed puzzle count like the swagger api says?
Avatar
I'd think so, I was imaging that the MongoDB would just be a filtered GET of data only needed to display on the leaderboard
13:06
I have it as avgSolveTime is a tiebreaker
Avatar
also, there are some Pojos for the Cells and Puzzle in webb.client.model.puzzle. I can get those moved into your new folder if whenever
Avatar
Avatar
Chris
I'd think so, I was imaging that the MongoDB would just be a filtered GET of data only needed to display on the leaderboard
sounds good, ill get that changed over. Just wanted to double check before I change the UI stuff
Avatar
@everyone I stubbed out controllers based on the api spec.working on getting tests. And a way to populate the database
Avatar
Avatar
Chris
@everyone I stubbed out controllers based on the api spec.working on getting tests. And a way to populate the database
Awesome! I'm planning to get the client requests.moved over to the new api spec today
Avatar
Avatar
Chris
@everyone I stubbed out controllers based on the api spec.working on getting tests. And a way to populate the database
@Chris I am about to start on the client implementation. You mind if I go and make the Pojo classes for everything?
10:43
I just don't want to do work twice, but I need them for implementing the client stuff lol
10:43
I'm happy to do it its easy
Avatar
Absolutely, good idea. I'll pull from your branch
Avatar
sounds good. I was going to make another branch for Pojo's, and merge it into my new client stuff. You can also merge that branch into your server stuff
Avatar
or if we want to make a separate branch... for pojos and then pull from there lol?
10:44
yeah
10:44
great
Avatar
ill get on it, and give you a ping once ive created them
Avatar
thanks Eric 🙂
Avatar
No worries
10:44
I got some downtime rn with no one home (edited)
Avatar
@Chris In the PuzzleLevel, CreatePuzzleLevel, and UpdatePuzzleLevel, I find the name solutions a bit confusing. Are we storing every possable solution to the puzzle, or just the solution thats in the json data?
11:22
Just wondering if I should make it an array of solutions or not
Avatar
As far as I am aware, there is only one solution possible per puzzle..? but regardless yeah that it should only be one. feel free to change it to "solution" I'll make an update (edited)
Avatar
Avatar
Chris
As far as I am aware, there is only one solution possible per puzzle..? but regardless yeah that it should only be one. feel free to change it to "solution" I'll make an update (edited)
I feel like there can be mutiple solutions, but maybe for only bigger puzzles? Just wanted to double check. Ill keep it as solution
Avatar
possibly haha
Avatar
@Chris https://github.com/plu-cs390/starb-webb/tree/DTOs/src/main/java/webb/shared/dtos I think this should be correct as per the swagger documentation, but it is currently untested
Avatar
Cool I'll take a look
Avatar
lmk if theres issues. It at least compiles 😛
11:57
I just merged it into my client stuff with very minimal merge conflicts, but then again ive modifed so much I am not suprised there were some
Avatar
@Chris for statistics, does the client or the server deside the persons current name and progress bar?
Avatar
That's right
Avatar
{ "username": "string", "stats": { "maxSolveTime": 0, "minSolveTime": 0, "avgSolveTime": 0, "puzzlesComplete": 0, "puzzlesMax": 0, "title": "Cadet" } } I was thinking of changing user stats to this
13:16
adding puzzlesMax and title. This way its one call to the server for all the stats
13:16
and its easy server side to add new titles etc
13:16
the puzzlesMax is used for the progress bar, its how many puzzles you need until a new title. Maybe it needs a different name?
Avatar
@Eric Golde, sure we can definitely add it to the server side. One thought though, is that puzzlesMax refers to the total number of puzzles available right?
Avatar
Puzzles max os the amount needed to level up. It's a very bad variable name lol
Avatar
Oh gotcha, well. I'm just trying to think about how we could make it easy to change the titles to something else without going into each document and updating it. And thanks for making those issues before we forget
Avatar
No worries. Working on populating the levels atm
17:38
One other, maybe rare issue I see is the puzzles endpoint /puzzles/{id} / /puzzles/{username} What if the ID and the username happen to be the same? I know its a edge case, but mabe user statistics about a puzzle should be /user-puzzle/ ?
Avatar
So just a heads up, it takes a few seconds to download all the puzzles now with the new API. I am thinking about making a loading screen for the main screen that waits until all puzzles are loaded
👍 1
18:30
If you click play without puzzles being loaded, you will never see any puzzles load until you restart the game
Avatar
Avatar
Eric Golde
One other, maybe rare issue I see is the puzzles endpoint /puzzles/{id} / /puzzles/{username} What if the ID and the username happen to be the same? I know its a edge case, but mabe user statistics about a puzzle should be /user-puzzle/ ?
I've added the diffs to that one issue
13:43
By the way, so the server is now able to load the puzzles into our mongodb. I am going to make a hot fix onto main of all the parsing related issues I found In short, this doesn't fix any logical errors present (wrong solutions or regions) but just makes it so we can get it in and out from our requests puzzle-1-1-10.json, unclosed square bracket, also numStars should be 2 puzzle-1-1-11.json, no solution, missing square brackets puzzle-1-1-12.json, missing squiggly braces, and no comma after before next key puzzle-1-1-13.json, missing comma in array puzzle-1-1-18.json, missing comma in array puzzle-1-1-24.json, extra comma, incorrect key name for solution puzzle-1-1-25.json, incorrect key name for solution, incorrect name for gridSize (edited)
13:45
we don't have a solution for puzzle-1-1-11
Avatar
Avatar
Chris
I've added the diffs to that one issue
Tysm! I fixed those files besides the missing solution in my branch but I forgot to commit just those to main
Avatar
No problem!
14:02
@Eric Golde I've also added serializers and deserializers and a converter for CellDTO. I've added validation annotations to the DTOs as well
Avatar
You rock!
14:19
I'm in a work meeting atm trying to plan the entire lught9ng and lighting budget for my work. I may be doing "proffessional" wiring even though I'm not licensed 🤐
👀 1
Avatar
Well, the server foundations are almost ready. This means that @Seth and @Brandon, you can pick up some of the stories that we have on Github
Avatar
Also, just a heads up for the server stuff. If you can please remember to write the content length header that would be great. My code uses that header to figure out the size of the file being downloaded
14:42
I can add it in if it's forgotten, its not the end of the world
Avatar
Gotcha! will do
Avatar
Just would be a nice to have haha
Avatar
is that for the loading screen?
Avatar
Avatar
Chris
is that for the loading screen?
Yes but planning to make the code check it actually downloaded the entire file just had a full day
15:09
Its a future I want to add but probs will never be a issue
15:09
Right now yes just loading screen uses it
Avatar
@Eric Golde Can you help me understand why there are multiple DTO's for each type of object (Created, Updated, etc.) and why I should be using specific ones? Trying to implement some endpoints currently
Avatar
Avatar
Brandon
@Eric Golde Can you help me understand why there are multiple DTO's for each type of object (Created, Updated, etc.) and why I should be using specific ones? Trying to implement some endpoints currently
Yes, they are named the same as they arer in Swagger
Avatar
Avatar
Brandon
@Eric Golde Can you help me understand why there are multiple DTO's for each type of object (Created, Updated, etc.) and why I should be using specific ones? Trying to implement some endpoints currently
When you are say you are implementing endpoints, are you talking about server or client side?
Avatar
Serverside I think? I didn't realize there was both. I'm looking at the controllers right now
Avatar
Avatar
Brandon
@Eric Golde Can you help me understand why there are multiple DTO's for each type of object (Created, Updated, etc.) and why I should be using specific ones? Trying to implement some endpoints currently
Really bad screenshot but thats the java name you should use
20:10
sorry in meeting rn with work 😭
Avatar
Avatar
Brandon
Serverside I think? I didn't realize there was both. I'm looking at the controllers right now
Ok gotcha, well be warned that I have a branch called serverFoundations where I implement the user leaderboard and user controllers, the rest of the controllers are stubbed out. Haven't add authorization quite yet https://github.com/plu-cs390/starb-webb/tree/serverFoundation
20:12
Please check out that out, I'll probably just do a PR at this point
Avatar
That's the branch I'm looking at currently
Avatar
oh ok good
Avatar
Okay, I'm working through the Puzzle Level Controller methods right now. I have most of the POST createPuzzleLevel done, but I'm not sure how a puzzle is assigned an ID. Currently I have it so that the user just gives it one as a RequestBody parameter. Is that the way to go? I'm also a little confused for the PATCH updatePuzzleLevel, as we don't seem to have any way of updating the PuzzleDTO object currently since all of its fields are declared final in CreatePuzzleDTO. Does it just completely replace the existing puzzle with a new one?
Avatar
the server should assign an id by the total puzzles in the db + 1. (edited)
Avatar
Is there a way to access that and feed it to the constructor for a new puzzle?
Avatar
The DTO itself cannot be patched, that'll be done through the repository. And as far as I know that's just through a .save()
21:17
In the puzzle controller, you can get the current count of the puzzleRepo and feed it in through there (edited)
Avatar
Avatar
Chris
The DTO itself cannot be patched, that'll be done through the repository. And as far as I know that's just through a .save()
I'm not sure exactly what the updatePuzzleLevel endpoint is doing then I guess
Avatar
updatePuzzleLevel is called when the user successfully completes a puzzle
Avatar
So its just for the number of users that completed a puzzle?
Avatar
Oh wait my bad, sorry. I was talking about user puzzle. The updatePuzzleLevel is a put, so you can essentially update anything you'd like, but yeah primarily the place where you update the number of users
21:20
I had it as a put because we might want to change some values via a request, but now thinking about we could just wipe the db clean and make any edits directly puzzle json files
Avatar
I guess I'm getting stuck because we can't update most of the values for a puzzle, because they are mostly inherited fields from the superclass CreatePuzzleLevelDTO in which they are all private and final (edited)
21:24
Or I'm just misunderstanding
Avatar
Hey @Chris do you think after class tomorrow we can go through DTO? I’ve been busy trying to fill out stuff for my internship
Avatar
Currently as it stands yeah the DTOs are final, but I'm not sure if they should...? the models definitely, but idk. You could instantiate the respective DTOs and then save that into the repo with the updated values? (edited)
Avatar
Avatar
Seth
Hey @Chris do you think after class tomorrow we can go through DTO? I’ve been busy trying to fill out stuff for my internship
Sure, I can catch you up to speed
Avatar
Avatar
Chris
Currently as it stands yeah the DTOs are final, but I'm not sure if they should...? the models definitely, but idk. You could instantiate the respective DTOs and then save that into the repo with the updated values? (edited)
Yeah, currently I think the only way to reasonably do it is to create a newly instantiated DTO with the new values and essentially overwrite the old one
21:27
The other option is to not have the fields like regions be final, and then add some setters to allow updates
Avatar
Yeah, that would be nice
Avatar
Okay, another question. Moving onto the UserPuzzlesController, it looks like we have a UserPuzzleDTO, which represents a players progress in a particular puzzle, but I can't seem to find if/where that is stored or associated server side. Does it have/need its own database or should it be stored with the user or something else?
Avatar
Yeah, a collection will need to be made for that
21:47
That way we can aggregate to get avgSolveTimes, maxSolveTime, minSolveTimes
21:47
for each user
Avatar
Sorry, by collection do you mean each user has a collection (List) of UserPuzzles?
Avatar
Oh sorry, not the Java collection. I mean mongo collection
Avatar
Okay, so a MongoDB collection (repository?). If thats the case, UserPuzzles may also need an additional field that stores which username it belongs to, because currently it lacks that
Avatar
Yep, new repo called UserPuzzlesRepository, and username sounds good. The _id could <username>-<level> or vice versa?
Avatar
Currently id is an int that represents the level. I could change it to include the username in some capacity since I assume you need that for Mongo searches?
Avatar
Yeah, it would helpful searching wise (edited)
Avatar
All right, that should be the remaining UserPuzzle server endpoints done, so in theory we are finished with the server endpoints at least according to the YAML doc. Changes should be pushed to ServerFoundation. I also updated the paths for PuzzleLevel and UserPuzzle controllers so they should match the updated YAML documentation. Haven't tested them just yet, but I'm taking a brain break, so if someone else wants to volunteer to do so, I would be most grateful. Otherwise, I'll see about giving it a look over late tonight/tomorrow.
19:48
@everyone
Avatar
@Brandon
19:49
oh crap, I was also working on it lol
Avatar
Oh, oopsies
Avatar
no its all good
19:49
my bad didnt say
Avatar
Well we can pick the best from both versions 😅
19:52
I'll make sure to go through now and look at the GitHub issues and try and mark the ones that are now actually done
Avatar
docker compose up -d
Avatar
sorry, thought this work meeting would be over by now. 😦 (edited)
Avatar
version: "3.7" services: mongodb: container_name: "mongodb" image: mongo:4.4 hostname: mongodb restart: always volumes: - ./data/mongodb/mongod.conf:/etc/mongod.conf - ./data/mongodb/initdb.d/:/docker-entrypoint-initdb.d/ - ./data/mongodb/data/db/:/data/db/ environment: - MONGO_INITDB_ROOT_USERNAME=root - MONGO_INITDB_ROOT_PASSWORD=root - MONGO_INITDB_DATABASE=development - MONGO_INITDB_USER=mongodb - MONGO_INITDB_PWD=mongodb ports: - 27017:27017 command: [ "-f", "/etc/mongod.conf" ]
22:55
set -e mongo <<EOF use $MONGO_INITDB_DATABASE db.createUser({ user: '$MONGO_INITDB_USER', pwd: '$MONGO_INITDB_PWD', roles: [{ role: 'readWrite', db: '$MONGO_INITDB_DATABASE' }] }) EOF (edited)
Avatar
@Chris ericshome.xyz:27017
22:59
webb.client.ui.helpers.http.WebbWebUtilities#BASE_URL (edited)
Avatar
I have a rudimentary version of the server completedish? Haven't done automated testing or anything but serverFoundationChris is most up to date
Avatar
Avatar
Chris
I have a rudimentary version of the server completedish? Haven't done automated testing or anything but serverFoundationChris is most up to date
Thanks man
Avatar
@Brandon are you free?
Avatar
Yes, what's up?
Avatar
So, I made some updates on my branch that include some of the changes we were talking about yesterday
19:12
But, there still needs to be tests made.
19:13
Do you think you can help me and Seth on that? I understand that you also have the class diagrams to work on to. NO pressure
Avatar
Yeah, my main project I wanted to get done was updating those class diagrams. I can try and help out with some of the tests though as well. Probably best to delegate those so we don't all end up working on the same ones by mistake. Are you referring specifically to the JUnit tests? Because I will need to look up exactly how to do them. I know Wolff put up a little about them
Avatar
Yeah the JUnit test
Avatar
Yeah, there are 4 tests that need to be done one for each controller
Avatar
Just 4?
Avatar
Sorry, 4 test suites
19:16
like a group of tests
Avatar
Okay, yeah that makes more sense
Avatar
I can probably take one of the suites
Avatar
From easiest to hardest: Leaderboard, User, Puzzle, UserPuzzle
Avatar
I’ll take the User
Avatar
You mind if I take Leaderboard then Chris, since I'm also working on Class Diagrams? Otherwise I can take one of the bigger ones
Avatar
Sure, that's cool
Avatar
Okay, now I wanted to check in. After I hopped off the call, I got to the point where I could launch the MongoDB database and get the repositories pulled up in IntelliJ, but I was still having trouble making calls through the YAML. I think you mentioned something about the Port Number possibly being wrong, so I want to make sure that there's not something special I have to do in regards to that.
Avatar
Yeah the port number on the Yaml so be 1391 I believe
Avatar
Did the YAML get updated to that?
19:20
i guess I could just look huh, but IntelliJ is being slow
Avatar
Yes you might need to pull from Chris version of server foundation or mine
Avatar
I just pulled Chris's changes so it should be good
Avatar
Yeah! I was gonna recommend that lol
Avatar
I will say that the swagger editor, doesn't work for some reason. We had it working on Seth's machine but now it's not. So it may not work for you either Brandon. You'd have to use some other REST client to test requests (edited)
19:22
aka Curl, HTTPie, Postman, Insomnia
Avatar
Gotcha, well I'm gonna focus on the JUnit tests for now, which I don't think use those, but I will keep that in mind
👍 2
Avatar
@everyone Wolff sent an email saying the JSON files were updated to work
Avatar
Oh cool, I'm looking at it
19:28
Looks like the changes were the same as I did puzzle-1-1-10.json, unclosed square bracket, also numStars should be 2 puzzle-1-1-11.json, no solution, missing square brackets puzzle-1-1-12.json, missing squiggly braces, and no comma after before next key puzzle-1-1-13.json, missing comma in array puzzle-1-1-18.json, missing comma in array puzzle-1-1-24.json, extra comma, incorrect key name for solution puzzle-1-1-25.json, incorrect key name for solution, incorrect name for gridSize
19:28
Except puzzle-1-1-11 still doesn't have a solution...
19:28
I see 23 and 21 aren't there
19:28
I'll take a look at it!
Avatar
Alright, it took me a while to work through the various DTO types in leaderboard, but the JUnit test for the Leaderboard controller is done and is working! Pushing the changes now
Avatar
alrighty!
Avatar
Oh also @Brandon , i heard you had trouble with getting docker and the mongo DB working. I have a public one hosted here: ericshome.xyz:27017 that hopefully you can connect and test with
Avatar
Oh I thank you, but it was moreso computer troubles, I actually got it working eventually
Avatar
ahh gotcha gotcha!
23:40
glad you got it working!
Exported 163 message(s)